<template>
  <div>
    <el-form-item v-bind="$attrs"
                  :label="label"
                  :prop="name"
                  :rules="formRules[name]"
                  label-width="120px">
      <el-input v-bind="$attrs"
                @input="handleInput"></el-input>
    </el-form-item>
  </div>
</template>

<script>
// import rulesMap from "@/libs/rulesMap";
export default {
  name: "AdvanceFormValid",
  props: {
    control: {
      type: String
    },
    name: {
      type: String
    },
    label: {
      type: String
    },
    filterEntries: {
      type: Array,
      default: () => []
    }
  },
  data () {
    return {
      rules: {}
    };
  },
  // computed: {
  //   formRules() {
  //     let entriesExist = this.filterEntries;
  //     const entriesMap = entriesExist.forEach((x) => {
  //       let m = rulesMap.get(x.validateName);
  //       this.$set(this.rules, x.name, [
  //         {
  //           required: x.test || false,
  //           message: m.message,
  //           trigger: ["blur", "change"],
  //           pattern: m.value
  //         }
  //       ]);
  //     });
  //     return this.rules;
  //   }
  // },
  created () { },
  methods: {
    handleInput (value) {
      this.$emit("input", value);
    }
  }
};
</script>
